class Person {
    constructor(name = "匿名") {
        this.name = name;
    }
    // 类方法会绑定在原型上，实例会继承
    getName() {
        return this.name;
    }
    setName(name) {
        this.name = name;
    }
}
var person = new Person("张三");
console.log(person.getName()); // 张三
person.setName("李四");
console.log(person.getName()); // 李四
class Girl extends Person {
    constructor(name, isSingle) {
        super(name);
        this.isSingle = isSingle;
    }
    getInfo = () => {
        return this.name + "：" + this.isSingle;
    }
}
var girl = new Girl("阿花", true);
console.log(girl.getInfo())